﻿using Microsoft.VisualStudio.TestTools.UITesting;
using Microsoft.VisualStudio.TestTools.UITesting.WinControls;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace CalculatorLittleRobust
{
    class CS362OperationButton
    {
        private WinWindow UIOpWindow;
        private WinButton UIOpButton;
        private string operation;

        public CS362OperationButton(string op)
        {
            this.operation = op;
            UIOpWindow = new WinWindow();
            if(op == "-")
            {
                UIOpWindow.SearchProperties[WinWindow.PropertyNames.ControlId] = "94";
            }
            else if (op == "+")
            {
                UIOpWindow.SearchProperties[WinWindow.PropertyNames.ControlId] = "93";
            }
            // add more operations here

            UIOpButton = new WinButton(UIOpWindow);

            if (op == "-")
            {
                UIOpButton.SearchProperties[WinButton.PropertyNames.Name] = "Subtract";

            }
            else if (op == "+")
            {
                UIOpButton.SearchProperties[WinButton.PropertyNames.Name] = "Add";
            }
            // add more operations here
        }


        public void Click()
        {
            Mouse.Click(UIOpButton);
        }


    }
}
